package app;

import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;

import java.lang.reflect.Type;
import java.util.List;

import home.bean.ApiResponse;

public class JsonParse {
    private static JsonParse instance;
    private JsonParse(){

    }
    public static JsonParse getInstance(){
        if (instance==null){
            instance=new JsonParse();
        }
        return instance;
    }
    public List<ApiResponse> getShopList(String json){
        Gson gson=new Gson();
        Type ListType=new TypeToken<List<ApiResponse>>(){}.getType();
        List<ApiResponse> shopList=gson.fromJson(json,ListType);
        return  shopList;
    }
    
}
